/*=====================================================
 Copyright (C) ETERNAL<iqstar@ms24.hinet.net>
 URL : http://www.et99.net

请仔细阅读以下许可协议。当您使用本软体，您将自动成为本协议的一方并受到本协议的约束。

软体和文档受到台湾及中国大陆著作权法及国际条约的保护。您不得：
a)营利、出租或者出借软体或文档的任何部分。
b)反向工程、分解、反编译或者企图察看软体的源代码作为商业用途。
c)修改或者改变软体，或者与其他程式结合。

许可人保留软体及文档的所有权利和权益。您不能通过本许可协定获得软体的任何所有权和知识产权。
===================================================== */

//##### shop begin #####
function select_store() {
    w_c('<form action="wog_act.php" method="post" target="mission" name="f1">');
    w_c(temp_table1);
    w_c('<tr><td colspan="2" class="head_td">请选择要进入的商店</td></tr>')
    w_c('<tr><td>装备道具商店 》</td><td><a class="uline" onClick="parent.shop_home_view(\'\',\'\',0,\'\',\'\')">【武器】</a> <a class="uline" onClick="parent.shop_home_view(\'\',\'\',1,\'\',\'\')">【头部】</a> <a class="uline" onClick="parent.shop_home_view(\'\',\'\',2,\'\',\'\')">【身体】</a> <a class="uline" onClick="parent.shop_home_view(\'\',\'\',3,\'\',\'\')">【手部】</a> <a class="uline" onClick="parent.shop_home_view(\'\',\'\',4,\'\',\'\')">【脚部】</a> <a class="uline" onClick="parent.th_submit(document.f1,1,\'5\')">【道具屋】</a> <a class="uline" onClick="parent.honor_view(null)">【勋章所】</a></td></tr>');
    w_c('<tr class=head_td3><td >其他商店 》</td><td><a class="uline" onClick="parent.act_click(\'plus\',\'view\')">【精炼房】</a> <a class="uline" onClick="parent.act_click(\'mercenary\',\'view\')">【佣兵所】</a> <a class="uline" onClick="parent.black_shop()">【换肤室】</a></td></tr>');
    w_c('<tr><td >其他商店  》</td><td><a class="uline" onClick="parent.act_click(\'syn\',\'list\')">【合成大师】</a> <a class="uline" onClick="parent.act_click(\'job\',\'view\')">【职业中心】</a> <a class="uline" onClick="parent.job_list();">【技能大师】</a></td></tr>');
    w_c('<tr class=head_td3><td >其他商店  》</td><td><a class="uline" onClick="parent.act_click(\'exchange\',\'view\')">【资源市场】</a> <!--<a class="uline" onClick="parent.act_click(\'mall\',\'view\')">【加值商城】</a>--></td></tr>');
    w_c('<tr><td >其他设施 》</td><td><a class="uline" onClick="parent.act_gclick(\'main\',\'view\')">【公会】</a> <a class="uline" onClick="parent.act_click(\'pet\',\'index\')">【牧场】</a> <a class="uline" onClick="parent.team_view()">【团队】</a> <a class="uline" onClick="parent.act_click(\'message\',\'list\')">【信箱】</a></td></tr>');
    w_c(temp_table2);
    w_c('<input type="hidden" name="f" value="shop">');
    w_c('<input type="hidden" name="act" value="view">');
    w_c('<input type="hidden" name="temp_id" value="">');
    w_c('<input type="hidden" name="temp_id2" value="">');
    w_c('</form>');
    p_c();
};

function mall_view(a1, a2, a3, a4) {
    w_c('<form action="wog_act.php" method="post" name="pageform" target="mission">');
    pagesplit(a3, a4);
    w_c('<input type="hidden" name="page" value="1">');
    w_c('<input type="hidden" name="f" value="mall">');
    w_c('<input type="hidden" name="act" value="view">');
    w_c('</form>');

    w_c('<form action="wog_act.php" method="post" target="mission" name="f1">');
    w_c(temp_table1);
    w_c('<tr class="head_td"><td></td><td>名称</td><td>说明</td><td>需求点数</td><td>库存数量</td></tr>');
    if (a1 != "") {
        var s1 = a1.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            w_c('<tr><td><input type="radio" name="temp_id" value="' + s2[0] + '"></td><td>' + s2[1] + '</td><td>' + s2[2] + '</td><td>' + s2[3] + '</td><td>' + s2[4] + '</td></tr>');
        }
    }
    w_c('<tr><td colspan="5">请填入数量(1-99) <input type="text" name="buy_num" size="2" maxlength="2" value=1> <input type="submit" value="确定兑换"></td></tr>');
    w_c('<tr><td colspan="5">剩余游戏点 : <span id="show_message">' + a2 + '</span></td></tr>');
    w_c('<input type="hidden" name="f" value="mall">');
    w_c('<input type="hidden" name="act" value="buy">');
    w_c(temp_table2);
    w_c('</form>');
    p_c();
};

function restup(a1, a2) {
    w_c(group_table1);
    var s1 = a1.split(",");
    w_c('<tr class="head_td2"><td class=b1 colspan="7">LV ' + s1[0] + ' 重新配点结果</td></tr>');
    w_c('<tr class="head_td"><td>力量</td><td>敏捷</td><td>智力</td><td>生命</td><td>体质</td><td>魅力</td><td>信仰</td></tr>');
    w_c('<tr><td>+' + s1[1] + '</td><td>+' + s1[2] + '</td><td>+' + s1[5] + '</td><td>+' + s1[3] + '</td><td>+' + s1[4] + '</td><td>+' + s1[7] + '</td><td>+' + s1[6] + '</td></tr>');
    w_c('<tr><td colspan="7">' + hr + '</td></tr>');
    var s1 = a2.split(",");
    w_c('<tr class="head_td2"><td colspan="7">现在基础状态</td></tr>');
    w_c('<tr class="head_td"><td>力量</td><td>敏捷</td><td>智力</td><td>生命</td><td>体质</td><td>魅力</td><td>信仰</td></tr>');
    w_c('<tr><td>' + s1[0] + '</td><td>' + s1[1] + '</td><td>' + s1[4] + '</td><td>' + s1[2] + '</td><td>' + s1[3] + '</td><td>' + s1[6] + '</td><td>' + s1[5] + '</td></tr>');
    w_c('<tr class="head_td2"><td colspan="7"><a href=javascript:parent.act_click(\'mall\',\'restup\');>重新配点</a> <a href=javascript:parent.act_click(\'chara\',\'status_view\');>角色状态</a></td></tr>');
    w_c('<tr ><td colspan="7">重新分配升级能力点数，需消耗 3 游戏点</td></tr>');
    w_c(temp_table2);
    p_c();
};

function honor_view(a, b, c, d, e, g) {
    w_c(temp_table1);
    w_c(item_store_menu);
    w_c(honor_menu);
    w_c(temp_table2);
    if (a != null) {
        w_c('<form action="wog_act.php" method="post" name="pageform" target="mission">');
        pagesplit(d, e);
        w_c('<input type="hidden" name="page" value="1">');
        w_c('<input type="hidden" name="temp_id" value="' + g + '">');
        w_c('<input type="hidden" name="f" value="honor">');
        w_c('<input type="hidden" name="act" value="list">');
        w_c('</form>');
    }
    w_c('<form action="wog_act.php" method="post" target="mission" name="f1">');
    w_c(temp_table1);
    if (a == null) {
        w_c('<tr><td>请选择种类</td></tr>');
        w_c(temp_table2);
        p_c();
        return;
    }
    w_c('<tr class="head_td"><td></td><td>名称</td><td>需求</td></tr>');
    var s1 = a.split(";");
    for (var i = 0; i < s1.length; i++) {
        var s2 = s1[i].split(",");
        var s3 = s2[2].split(":");
        var temp = "";
        for (var j = 0; j < s3.length; j++) {
            var s4 = s3[j].split("*");
            temp += "," + honor_name[s4[0]] + "*" + s4[1];
        }
        temp = temp.substr(1, temp.length);
        w_c('<tr><td><input type="radio" name="h_id" value="' + s2[0] + '"></td><td><a href="javascript:parent.foot_turn(\'' + b + '\',\'check_item\',\'' + c + '\',' + s2[3] + ')">' + s2[1] + '</a></td><td>' + temp + '</td></tr>');
    }
    w_c('<tr><td colspan="3" ><input type="submit" value="确定兑换"></td></tr>');
    w_c('<tr><td colspan="3" ><div id="show_message"></div></td></tr>');
    w_c('<input type="hidden" name="f" value="honor">');
    w_c('<input type="hidden" name="act" value="buy">');
    w_c(temp_table2);
    w_c('</form>');
    p_c();
};

function shop_home_view(s, a, temp_id, ss, temp_id2, df_total, page, money) {
    w_c('<form action="wog_act.php" method="post" name="f2" target="mission">');
    w_c(temp_table1 + item_store_menu);
    if (temp_id != "5") {
        w_c('<tr><td>物品等级 : ' + shop_type_lv[temp_id] + '</td></tr>');
        w_c('<input type="hidden" name="f" value="shop">');
        w_c('<input type="hidden" name="act" value="view">');
        w_c('<input type="hidden" name="temp_id" value="">');
    }
    w_c(temp_table2 + '<input type="hidden" name="temp_id2" value=""></form>');
    if (temp_id2 == "" && temp_id != "5") {
        w_c(temp_table1 + '<tr class="head_td2"><td>请选择物品等级</td></tr>' + temp_table2);
        p_c();
        return;
    }
    w_c('<form action="wog_act.php" method="post" name="pageform" target="mission">');
    pagesplit(df_total, page);
    w_c('<input type="hidden" name="page" value="">');
    w_c('<input type="hidden" name="f" value="shop">');
    w_c('<input type="hidden" name="act" value="view">');
    w_c('<input type="hidden" name="temp_id" value="' + temp_id + '">');
    w_c('<input type="hidden" name="temp_id2" value="' + temp_id2 + '">');
    w_c('</form>');
    w_c('<form action="wog_act.php" method="post" target="mission">');
    w_c(temp_table1);
    w_c('<tr class="head_td"><td></td><td>名称</td><td><u title="物理攻击力">物攻</u></td><td><u title="魔法攻击力">魔攻</u></td><td><u title="物理防御力">物防</u></td><td><u title="魔法防御力">魔防</u></td><td>职业</td><td>能力限制</td><td>价格</td></tr>');
    if (s != "") {
        var s1 = s.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            var temp_message = s2[4] + "," + s2[12] + "," + s2[13] + "," + s2[14] + "," + s2[17] + "," + s2[16] + "," + s2[18] + "," + s2[15] + ",,," + s2[19] + "," + s2[20] + "," + s2[3] + ",0";
            w_c('<tr><td ><input type="radio" name="adds" value="' + s2[0] + '"></td><td><a href="javascript:return false" onmouseover=parent.wog_message_box("' + temp_message + '",1,4,null,event.x||event.pageX,event.y||event.pageY); onmouseout=parent.hidebox(\'wog_message_box\')>' + s2[4] + '</a></td><td>' + s2[5] + '</td><td>' + s2[6] + '</td><td>' + s2[1] + '</td><td>' + s2[2] + '</td><td>' + s2[11] + '</td><td>' + arm_need_status(s2[7], s2[8], s2[9], s2[10]) + '</td><td>' + s2[3] + '</td></tr>');
        }
    } else {
        w_c('<tr><td colspan="10" >没有可以使用的装具</td></tr>');
    }
    if (ss != "") {
        s1 = ss.split(";");
        for (var i = 0; i < s1.length; i++) {
            s2 = s1[i].split(",");
            var temp_message = s2[0] + "," + s2[5] + "," + s2[6] + "," + s2[7] + "," + s2[8] + "," + s2[9] + "," + s2[10] + "," + s2[11] + "," + s2[12] + "," + s2[13] + "," + s2[18] + "," + s2[19] + "," + s2[16] + "," + s2[22];
            w_c('<tr bgcolor="#777779"><td><font color="#FF0000">E</font></td><td><a href="#" onmouseover=parent.wog_message_box("' + temp_message + '",1,4,null,event.x||event.pageX,event.y||event.pageY); onmouseout=parent.hidebox(\'wog_message_box\'); ondblclick="parent.set_arm_tochat(\'' + s2[0] + '\',\'' + s2[20] + '\');" target="mission">' + s2[0] + '</a></td><td>' + bf_c(s2[1]) + '</td><td>' + bf_c(s2[2]) + '</td><td>' + bf_c(s2[3]) + '</td><td>' + bf_c(s2[4]) + '</td><td>---</td><td>---</td><td>' + s2[16] + '</td></tr>');
        }
    }
    if (temp_id == "5") {
        w_c('<tr><td colspan="10">请填入数量(1-99) <input type="text" name="buy_num" size="2" maxlength="2"></td></tr>');
    }
    w_c('<tr><td colspan="10" ><input type="submit" value="确定购买"></td></tr>');
    w_c('<tr><td colspan="2">身上金额</td><td colspan="8" ><div id="show_message"> ' + money + '</div></td></tr>');
    w_c(temp_table2);
    w_c('<input type="hidden" name="f" value="shop">');
    w_c('<input type="hidden" name="act" value="buy">');
    w_c('<input type="hidden" name="temp_id" value="' + temp_id + '">');
    w_c('</form>');
    p_c();
};

function black_shop() {
    w_c('<form action="wog_act.php" method="post" target="mission">');
    w_c('<input type="hidden" name="f" value="store">');
    w_c('<input type="hidden" name="act" value="img">');
    w_c(temp_table1);
    w_c('<tr><td>变更角色图像</td></tr>');
    w_c('<tr><td>输入图像编号 <input type="text" name="num" size="2"> <a href="javascript://" onClick="window.open(\'wog_etc.php?f=img\',\'\',\'menubar=no,status=no,scrollbars=yes,top=50,left=50,toolbar=no,width=400,height=400\')">图像预览</a></td></tr>');
    w_c('<tr><td><input type="submit" value="使用系统图像"></td></tr>');
    w_c('<tr><td>变脸手术需花1000</td></tr>');
    w_c(temp_table2);
    w_c('</form>');
    w_c('<p>');
    w_c('<form action="wog_act.php" method="post" target="mission">');
    w_c('<input type="hidden" name="f" value="store">');
    w_c('<input type="hidden" name="act" value="img2">');
    w_c(temp_table1);
    w_c('<tr><td>输入图像连结 <input type="text" name="url" value="http://" size="45" maxlength="150"> </td></tr>');
    w_c('<tr><td>(最佳size请勿超过 120*120)</td></tr>');
    w_c('<tr><td><input type="submit" value="使用自订图像"></td></tr>');
    w_c('<tr><td>变脸手术需花3000</td></tr>');
    w_c(temp_table2);
    w_c('</form>');
    p_c();
};

/**
 * 拍卖
 * @param s
 * @param b
 */
function sale_item(s, b) {
    console.log(s, b)
    var temp_s =s;
    // if (s ) {
    //     if (s.length) {
    //         for (var i = 0; i < s.length; i++) {
    //             if (s[i].checked == true) {
    //                 temp_s = s[i].value;
    //                 break;
    //             }
    //         }
    //     } else {
    //         temp_s = s.value;
    //     }
    // }
    var s1 = temp_s.split(",");
    if (temp_s != "") {
        arm_link();

        if (s1[1].indexOf("*") > -1) {
            var temp = s1[1].split("*");
            var d_name = temp[0];
        } else {
            var d_name = s1[1];
        }
        w_c('<form action="wog_act.php" method="post" target="mission">');
        w_c(temp_table1);
        w_c('<tr><td colspan="3">拍卖‘' + d_name + '*' + b + '’</td></tr>');
        w_c('<tr><td>起标价格:<input type="text" name="money" size="20" maxlength="20" value="1"></td><td>结标价格:<input type="text" name="e_money" size="20" maxlength="20" value="0"></td><td>拍卖时间:<input type="text" name="day" size="2" maxlength="2" value="1">天</td></tr>');
        w_c('<tr><td colspan="3"><input type="submit" value="开始拍卖"></td></tr>');
        w_c('<tr><td colspan="3" class=b1><ol><li>拍卖时间不能超过10天,一人拍卖的商品不能超过5种</li><li>拍卖时间单位为天数,时间到期自动下架</li><li>拍卖会收取起标价手续费</li><li>拍卖过期物品会自动放入玩家背包，当背包无法放入时会自动放入信箱(<a href=javascript:parent.act_click(\'message\',\'item_list\')>取物</a>)</li></ol></td></tr>');
        w_c(temp_table2);
        w_c('<input type="hidden" name="f" value="sale">');
        w_c('<input type="hidden" name="act" value="sale">');
        w_c('<input type="hidden" name="item_id" value="' + s1[0] + '">');
        w_c('<input type="hidden" name="item_num" value="' + b + '">');
        w_c('</form>');
        p_c();
    } else {
        parent.$.toast({text: "请选择拍卖物品", position: 'top-center'});
    }
};

function sale_view(saletotal, page, s, type, key)//拍卖区
{
    w_c('<form action="wog_etc.php" method="get" name="pageform" target="mission">');
    pagesplit(saletotal, page);
    w_c('<input type="hidden" name="page" value="1">');
    w_c('<input type="hidden" name="type" value="' + type + '">');
    w_c('<input type="hidden" name="f" value="sale">');
    w_c('<input type="hidden" name="act" value="view">');
    w_c('<input type="hidden" name="key" value="' + key + '">');
    w_c('</form>');
    w_c('<form action="wog_act.php" method="post" target="mission" name=f1>');
    w_c(temp_table1);
    w_c('<tr><td colspan="18"><a href=javascript:parent.sel_type("0");>武器</a> <a href=javascript:parent.sel_type("1");>头部</a>  <a href=javascript:parent.sel_type("2");>身体</a> <a href=javascript:parent.sel_type("3");>手套</a> <a href=javascript:parent.sel_type("4");>鞋子</a> <a href=javascript:parent.sel_type("5");>道具</a> <a href=javascript:parent.sel_type("6");>宠物</a> <a href=javascript:parent.sel_type("7");>魔石</a> <a href=javascript:parent.sel_type("10");>精炼石</a></td></tr>');
    w_c('<tr><td colspan="18">拍卖商品</td></tr>');
    switch (type) {
        case 6:
            w_c('<tr class="head_td"><td></td><td>拍卖者</td><td>商品</td><td>AT</td><td>MT</td><td>DEF</td><td>个性</td><td>年纪</td><td>出击值</td><td>底价</td><td>剩余日</td></tr>');
            break;
        case 7:
            w_c('<tr class="head_td"><td></td><td>拍卖者</td><td>商品</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>敏捷</td><td>力量</td><td>生命</td><td>体质</td><td>智力</td><td>魅力</td><td>信仰</td><td>HP</td><td>底价</td><td>结标价</td><td>剩余日</td></tr>');
            break;
        default:
            w_c('<tr class="head_td"><td></td><td>拍卖者</td><td>商品</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>洞数</td><td>职业</td><td>能力限制</td><td>底价</td><td>结标价</td><td>剩余日</td></tr>');
            break;
    }
    if (s != "") {
        var s1 = s.split(";");
        var temp_form = "document.f1";
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            var now_date = new Date();
            var sale_day = null;
            var temp_stone_list = "";
            switch (type) {
                case 6:
                    sale_day = Math.ceil((s2[11] - (now_date.getTime() / 1000)) / (60 * 60 * 24));
                    w_c('<tr><td><input type="radio" name="sp_id" value="' + s2[1] + '"></td><td>' + s2[0] + '</td><td>' + s2[2] + '-' + s2[3] + '</td><td>' + s2[4] + '</td><td>' + s2[5] + '</td><td>' + s2[6] + '</td><td>' + pet_type(s2[7]) + '</td><td>' + s2[8] + '</td><td>' + s2[9] + '</td><td>' + s2[10] + '</td><td>' + sale_day + '</td></tr>');
                    break;
                case 7:
                    if (s2[13] == "0") {
                        s2[13] = "∞";
                    }
                    sale_day = Math.ceil((s2[16] - (now_date.getTime() / 1000)) / (60 * 60 * 24));
                    w_c('<tr><td><a class="uline" onclick="' + temp_form + '.act.value=\'buy\';' + temp_form + '.s_id.value=\'' + s2[14] + '\';parent.sale_mbuy(event.x||event.pageX,event.y||event.pageY);">竞标</a> <a class="uline" onclick="if(confirm(\'确认是否购买\')){' + temp_form + '.s_id.value=\'' + s2[14] + '\';' + temp_form + '.act.value=\'buy3\';' + temp_form + '.submit();}">直购</a></td><td>' + s2[0] + '</td><td><a class=uline onclick=parent.arm_show(event.ctrlKey,"' + s2[1] + '","' + s2[19] + '") >' + s2[1] + '</a>*' + s2[17] + '</td><td>' + s2[2] + '</td><td>' + s2[3] + '</td><td>' + s2[4] + '</td><td>' + s2[5] + '</td><td>' + s2[6] + '</td><td>' + s2[7] + '</td><td>' + s2[8] + '</td><td>' + s2[9] + '</td><td>' + s2[10] + '</td><td>' + s2[11] + '</td><td>' + s2[12] + '</td><td>' + s2[20] + '</td><td>' + s2[15] + '</td><td>' + s2[13] + '</td><td>' + sale_day + '</td></tr>');
                    break;
                default:
                    if (s2[25] == "0") {
                        s2[25] = "∞";
                    }
                    sale_day = Math.ceil((s2[27] - (now_date.getTime() / 1000)) / (60 * 60 * 24));
                    var temp_message = s2[2] + "," + s2[7] + "," + s2[8] + "," + s2[9] + "," + s2[10] + "," + s2[11] + "," + s2[12] + "," + s2[13] + "," + s2[14] + "," + s2[15] + "," + s2[24] + "," + s2[29] + ",---," + s2[30];
                    w_c('<tr><td><a class="uline" onclick="' + temp_form + '.act.value=\'buy\';' + temp_form + '.s_id.value=\'' + s2[0] + '\';parent.sale_mbuy(event.x||event.pageX,event.y||event.pageY);">竞标</a> <a class="uline" onclick="if(confirm(\'确认是否购买\')){' + temp_form + '.s_id.value=\'' + s2[0] + '\';' + temp_form + '.act.value=\'buy3\';' + temp_form + '.submit();}">直购</a></td><td>' + s2[28] + '</td><td><a class=uline onclick=parent.arm_show(event.ctrlKey,"' + s2[2] + '","' + s2[1] + '") onmouseover=parent.wog_message_box("' + temp_message + '",1,4,null,event.x||event.pageX,event.y||event.pageY); onmouseout=parent.hidebox(\'wog_message_box\')>' + s2[2] + '</a></td><td>' + bf_c(s2[3]) + '</td><td>' + bf_c(s2[4]) + '</td><td>' + bf_c(s2[5]) + '</td><td>' + bf_c(s2[6]) + '</td><td>' + s2[24] + '</td><td>' + s2[21] + '</td><td>' + arm_need_status(s2[16], s2[17], s2[18], s2[19]) + '</td><td>' + s2[26] + '</td><td>' + s2[25] + '</td><td>' + sale_day + '</td></tr>');
                    break;
            }
        }
    }
    if (type == 6) {
        w_c('<input type="hidden" name="stype" value="1">');
        w_c('<tr><td colspan="17" ><input type="submit" value="确定购买"></td></tr>');
    } else {
        w_c('<input type="hidden" name="stype" value="0">');
    }
    w_c('<input type="hidden" name="f" value="sale">');
    w_c('<input type="hidden" name="act" value="buy">');
    w_c('<input type="hidden" name="type" value="' + type + '">');
    w_c('<input type="hidden" name="money" value=""><input type="hidden" name="s_id" value="">');
    w_c(temp_table2);
    w_c('</form>');
    w_c('<form action="wog_etc.php" method="get" name="serchform" target="mission" onsubmit="if(this.key.value==\'\'){alert(\'请输入搜寻字\');return false;}">');
    w_c(temp_table1);
    w_c('<tr><td colspan="17"><input type="text" name="key" size="16"> <input type="submit" value="搜寻" ></td></tr>');
    w_c('<input type="hidden" name="type" value="' + type + '">');
    w_c('<input type="hidden" name="f" value="sale">');
    w_c('<input type="hidden" name="act" value="view">');
    w_c(temp_table2);
    w_c('</form>');
    p_c();
};

function sale_mbuy(x, y) {
    w_c(build_table1);
    w_c('<tr><td>请输入竞标金额:<input type="text" name="money" value="" size="10" ></td></tr>');
    w_c('<tr><td colspan="2"><input type="button" value="确定送出" onclick="document.f1.money.value=this.form.money.value;document.f1.submit();parent.p_s_close();"> <input type="button" value="取消" onClick="parent.p_s_close();"></td></tr>');
    w_c(temp_table2);
    w_c('<input type="hidden" name="f" value="sale">');
    w_c('<input type="hidden" name="act" value="sale2">');
    p_as(x, y);
}

function sale2_view(saletotal, page, s, type, key)//收购区
{
    w_c('<form action="wog_etc.php" method="get" name="pageform" target="mission">');
    pagesplit(saletotal, page);
    w_c('<input type="hidden" name="page" value="1">');
    w_c('<input type="hidden" name="type" value="' + type + '">');
    w_c('<input type="hidden" name="f" value="sale">');
    w_c('<input type="hidden" name="act" value="view2">');
    w_c('<input type="hidden" name="key" value="' + key + '">');
    w_c('</form>');
    w_c('<form action="wog_act.php" method="post" target="mission" name=f1>');
    w_c(temp_table1);
    w_c('<tr><td colspan="17"><a href=javascript:parent.sel_type("0");>武器</a> <a href=javascript:parent.sel_type("1");>头部</a>  <a href=javascript:parent.sel_type("2");>身体</a> <a href=javascript:parent.sel_type("3");>手套</a> <a href=javascript:parent.sel_type("4");>鞋子</a> <a href=javascript:parent.sel_type("5");>道具</a> <a href=javascript:parent.sel_type("7");>魔石</a> <a href=javascript:parent.sel_type("10");>精炼石</a></td></tr>');
    w_c('<tr><td colspan="17">收购商品</td></tr>');
    switch (type) {
        case 7:
            w_c('<tr class="head_td"><td></td><td>收购者</td><td>商品</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>敏捷</td><td>力量</td><td>生命</td><td>体质</td><td>智力</td><td>魅力</td><td>信仰</td><td>金额</td><td>原价</td><td>剩余日</td></tr>');
            break;
        default:
            w_c('<tr class="head_td"><td></td><td>收购者</td><td>商品</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>洞数</td><td>职业</td><td>能力限制</td><td>金额</td><td>原价</td><td>剩余日</td></tr>');
            break;
    }
    var s1 = s.split(";");
    if (s != "") {
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            var now_date = new Date();
            var sale_day = Math.ceil((s2[13] - (now_date.getTime() / 1000)) / (60 * 60 * 24));
            switch (type) {
                case 7:
                    sale_day = Math.ceil((s2[16] - (now_date.getTime() / 1000)) / (60 * 60 * 24));
                    w_c('<tr><td><input type="radio" name="s_id" value="' + s2[14] + '"></td><td>' + s2[0] + '</td><td>' + s2[1] + '*' + s2[17] + '</td><td>' + s2[2] + '</td><td>' + s2[3] + '</td><td>' + s2[4] + '</td><td>' + s2[5] + '</td><td>' + s2[6] + '</td><td>' + s2[7] + '</td><td>' + s2[8] + '</td><td>' + s2[9] + '</td><td>' + s2[10] + '</td><td>' + s2[11] + '</td><td>' + s2[12] + '</td><td>' + s2[15] + '</td><td>' + s2[13] + '</td><td>' + sale_day + '</td></tr>');
                    break;
                default:
                    var temp_message = s2[1] + "," + s2[18] + "," + s2[19] + "," + s2[20] + "," + s2[23] + "," + s2[22] + "," + s2[24] + "," + s2[21] + "," + s2[25] + "," + "," + s2[17] + "," + s2[26] + "," + s2[10];
                    w_c('<tr><td><input type="radio" name="s_id" value="' + s2[11] + '"></td><td>' + s2[0] + '</td><td><a class=uline onmouseover=parent.wog_message_box("' + temp_message + '",1,4,null,event.x||event.pageX,event.y||event.pageY); onmouseout=parent.hidebox(\'wog_message_box\')>' + s2[1] + '</a>*' + s2[15] + '</td><td>' + s2[2] + '</td><td>' + s2[3] + '</td><td>' + s2[4] + '</td><td>' + s2[5] + '</td><td>' + s2[17] + '</td><td>' + s2[14] + '</td><td>' + arm_need_status(s2[6], s2[7], s2[8], s2[9]) + '</td><td>' + s2[12] + '</td><td>' + s2[10] + '</td><td>' + sale_day + '</td></tr>');
                    break;
            }
        }
    }
    w_c('<tr><td colspan="17"><input type="submit" value="确定收购者"> <input type="button" value="张贴收购" onclick="parent.sale2_post(event.x||event.pageX,event.y||event.pageY);"></td></tr>');
    w_c('<input type="hidden" name="f" value="sale">');
    w_c('<input type="hidden" name="act" value="buy2">');
    w_c('<input type="hidden" name="type" value="' + type + '">');
    w_c(temp_table2);
    w_c('</form>');
    w_c('<div id="sel_item"></div>');
    w_c('<form action="wog_etc.php" method="get" name="serchform" target="mission" onsubmit="if(this.key.value==\'\'){alert(\'请输入搜寻字\');return false;}">');
    w_c(temp_table1);
    w_c('<tr><td colspan="17"><input type="submit" value="搜寻" > <input type="text" name="key" size="16"></td></tr>');
    w_c('<input type="hidden" name="type" value="' + type + '">');
    w_c('<input type="hidden" name="f" value="sale">');
    w_c('<input type="hidden" name="act" value="view2">');
    w_c(temp_table2);
    w_c('</form>');
    p_c();
};

function arm2_view(a1, a4, a5) {
    var temp_str = "";
    var sum = 0;
    temp_str += '<form action="wog_act.php" method="post" target="mission" name=f1>' + temp_table1;
    if (a4 != 7) {
        temp_str += '<tr class="head_td"><td></td><td>名称</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>职业</td><td>属性</td></tr>';
    } else {
        temp_str += '<tr class="head_td"><td></td><td>名称</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>敏捷</td><td>力量</td><td>生命</td><td>体质</td><td>智力</td><td>魅力</td><td>信仰</td></tr>';
    }
    if (a1 != "") {
        var s1 = a1.split(";");
        for (var i = 0; i < s1.length; i++) {
            var arm_view_color = "";
            var s2 = s1[i].split(",");
            sum++;
            if (a4 != 7) {
                if (s2[15] == "1") {
                    arm_view_color = "bgcolor=" + nosend;
                }
                var temp_message = s2[1] + "," + s2[6] + "," + s2[7] + "," + s2[8] + "," + s2[9] + "," + s2[10] + "," + s2[11] + "," + s2[12] + "," + s2[13] + "," + s2[14] + "," + s2[19] + "," + s2[20] + "," + s2[17];
                temp_str += '<tr><td>' + sum + '. <input type="radio" name="adds" value="' + s2[0] + '"></td><td ' + arm_view_color + '><a href="#" onmouseover=parent.wog_message_box("' + temp_message + '",1,4,null,event.x||event.pageX,event.y||event.pageY); onmouseout=parent.hidebox(\'wog_message_box\');>' + s2[1] + '</a></td><td>' + bf_c(s2[2]) + '</td><td>' + bf_c(s2[3]) + '</td><td>' + bf_c(s2[4]) + '</td><td>' + bf_c(s2[5]) + '</td><td>' + s2[20] + '</td><td>' + s_status[s2[18]] + '</td></tr>';
            } else {
                temp_str += '<tr><td>' + sum + '. <input type="radio" name="adds" value="' + s2[0] + '"></td><td >' + s2[13] + temp_num + '</td><td>' + s2[1] + '</td><td>' + s2[2] + '</td><td>' + s2[3] + '</td><td>' + s2[4] + '</td><td>' + s2[5] + '</td><td>' + s2[6] + '</td><td>' + s2[7] + '</td><td>' + s2[8] + '</td><td>' + s2[9] + '</td><td>' + s2[10] + '</td><td>' + s2[11] + '</td></tr>';
            }

        }
        temp_str += '<tr><td colspan="8"><input type="submit" value="确定卖出"></td></tr>';
    }
    temp_str += temp_table2;
    temp_str += '<input type="hidden" name="f" value="sale">';
    temp_str += '<input type="hidden" name="act" value="buy2_1">';
    temp_str += '<input type="hidden" name="s_id" value="' + a5 + '">';
    temp_str += '<input type="hidden" name="type" value=' + a4 + '>';
    temp_str += "</form>";
    f.getElementById("sel_item").innerHTML = temp_str;
}

function sale2_post(x, y) {
    w_c(build_table1);
    w_c('<tr><td>收购价格:</td><td><input type="text" name="money" value="" size="10" ></td><td>收购时间:</td><td><input type="text" name="day" value="" size="10" ></td></tr>');
    w_c('<tr><td>收购物品:</td><td><input type="text" name="d_name" value="" size="10" ></td><td>物品洞数:</td><td><input type="text" name="d_hole" value="" size="10" ></td></tr>');
    w_c('<tr><td>收购数量:</td><td><input type="text" name="item_num" value="1" size="10" ></td></tr>');
    w_c('<tr><td colspan="4"><input type="submit" value="确定送出" > <input type="button" value="取消" onClick="parent.p_s_close();"></td></tr>');
    w_c('<tr><td colspan="4" class=b1><ol><li>收购时间不能超过10天</li><li>武器防具类收购数量强制为1</li><li>道具魔石类洞数强制为0</li><li>张贴收购会预收出价金额</li><li>收购到期且无人进行交易时金额会返回玩家身上</li><li>收购最低金额为1000元</li></ol></td></tr>')
    w_c(temp_table2);
    w_c('<input type="hidden" name="f" value="sale">');
    w_c('<input type="hidden" name="act" value="sale2">');
    p_as(x, y);
};

//##### bank #####
function bank(a, b) {
    w_c(temp_table1 + bank_depot_menu + temp_table2);
    w_c('<form action="wog_act.php" method="post" target="mission">');
    w_c(temp_table1);
    w_c('<tr class="head_td"><td colspan="2" >身上现金 : ' + a + ' , 银行存款 : ' + b + '</td></tr>');
    w_c('<tr><td  width="70%">金额 <input type="text" name="money" size="5"></td><td ><input type="submit" value="存款"></td></tr>');
    w_c('<input type="hidden" name="f" value="bank">');
    w_c('<input type="hidden" name="act" value="save">');
    w_c(temp_table2);
    w_c('</form>');
    w_c('<form action="wog_act.php" method="post" target="mission">');
    w_c(temp_table1);
    w_c('<tr><td width="70%">金额 <input type="text" name="money" size="5"></td><td ><input type="submit" value="提款"></td></tr>')
    w_c('<input type="hidden" name="f" value="bank">');
    w_c('<input type="hidden" name="act" value="get">');
    w_c(temp_table2);
    w_c('</form>');
    w_c('<form name=f1>');
    w_c(temp_table1);
    w_c('<tr><td width="70%">金额 <input type="text" name="money" size="5"> ,对象帐号 <input type="text" name="pay_id" size="6"></td><td ><input type="button" value="转帐" onclick="parent.foot_turn(\'bank\',\'pay\',document.f1.pay_id.value,document.f1.money.value,null)"></td></form></tr>');
    w_c(temp_table2);
    w_c('</form>');
    p_c();
};

function mercenary_view(a, b, c) {
    var temp_status = "";
    var area_set = "";
    w_c('<form action="wog_act.php" method="post" target="mission" name=f1 >');
    if (job_work.mercenary_start == null || job_work.mercenary_start == undefined) {
        mercenary_f();
    }
    w_c(left_table1);
    w_c('<tr><td colspan="8" class=b1>欢迎来到佣兵所,请选择欲雇用的佣兵,佣兵属性能力及技能与玩家相同,不同等级佣兵战斗获得的金钱跟宝物的比例不同,例F级佣兵战斗获得的金钱为原来的30%,打宝率为原来的30%,经验值为原来的65%。死亡消耗为佣兵战败时,需要扣减多少战斗次数</td></tr>');
    w_c('<tr class="head_td"><td></td><td>名称</td><td>价格</td><td>战斗次数</td><td>金钱</td><td>宝物</td><td>经验</td><td>死亡消耗</td></tr>');
    if (a != "") {
        var s1 = a.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            w_c('<tr><td><input type="radio" name="item_id" value="' + s2[0] + '"></td><td>' + s2[1] + '</td><td>' + s2[2] + '</td><td>' + s2[3] + '</td><td>' + s2[4] + '%</td><td>' + s2[5] + '%</td><td>' + s2[6] + '%</td><td>' + s2[7] + '</td></tr>');
        }
    }
    w_c('<tr><td colspan="8"><input type="submit" value="确认雇用"></td></tr>');
    w_c('<input type="hidden" name="f" value="mercenary">');
    w_c('<input type="hidden" name="act" value="buy">');
    w_c(temp_table2);
    w_c('</form>');
    w_c('<form action="wog_act.php" method="post" target="mission" name=f2 >');
    w_c(right_table1);
    if (b != "") {
        w_c('<tr class="head_td"><td>名称</td><td>状态</td><td>设定</td><td>剩余次数</td></tr>');
        var s1 = b.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            if (s2[1] == '0') {
                temp_status = "休息中";
            }
            if (s2[1] == '1') {
                temp_status = "战斗中";
            }
            w_c('<tr><td><input type="text" name="me_name" value="' + s2[3] + '" maxlength="8" size="8"></td><td>' + temp_status + '</td><td><select name="status" ><option value="0" >停止战斗</option><option value="1" >开始战斗</option><option value="2" >解除雇用</option></select></td><td>' + s2[2] + '</td></tr>');
            w_c('<tr><td>选择冒险地  :</td><td>' + sec[s2[4]][0] + '</td><td colspan="2" class=b1>' + temp_country);
            w_c(' <select name="act1" ><option value="" SELECTED>选择场所</option></select></td></tr>');
        }
        area_set = s2[1];
        w_c('<tr><td colspan="4"><input type="submit" value="确认设定"></td></tr>');
        w_c('<input type="hidden" name="f" value="mercenary">');
        w_c('<input type="hidden" name="act" value="set">');
        w_c('<input type="hidden" name="item_id" value="' + s2[0] + '">');
        w_c('<tr><td colspan="4">' + hr + '</td></tr>');
        if (c != "") {
            var s1 = c.split(";");
            for (var i = 0; i < s1.length; i++) {
                var s2 = s1[i].split(",");
                w_c('<tr><td colspan="4" class=b1>' + s2[0] + ' at ' + s2[1] + '</td></tr>');
            }
        }
        w_c(temp_table2);
        w_c('</form>');
        w_c('<script language="JavaScript">document.f2.status.value=' + area_set + ';</script>');
    }
    p_c();
};

/**
 * 佣兵战斗提示
 * @param a1
 * @param a2
 */
function mercenary_job_view(a1, a2) {
    if (f.getElementById("wog_mercenary_job")) {
        set_window();
        f.getElementById("wog_mercenary_job").innerHTML = mercenary_table1 + '<tr><td class="px-10 py-5">' + a1 + ' </td><td width="40"><a href="javascript:;"  onclick="parent.mercenary_job_close();" class="click text-prompt text-nowraps font-size-12">关闭</a></td></tr>' + temp_table2;
        //window.setTimeout("mercenary_job_close()",5000);
        if (a2 == null) {
            window.setTimeout("mercenary_job_close(1)", 5000);
        }
    }
};

/**
 * 佣兵雇佣次数消耗完毕后
 * @param a1
 */
function mercenary_job_close(a1) {
    if (f.getElementById("wog_mercenary_job")) {
        f.getElementById("wog_mercenary_job").style.display = "none";
        f.getElementById("wog_mercenary_job").innerHTML = "";
        if (mercenary_set == 0 && a1 != null) {
            mercenary_job_view("佣兵战斗次数为0，[<a href=javascript:parent.act_click(\'mercenary\',\'view\')>继续雇用</a>]", 1);
        }
    }
};

function exchange_view(a, b) {
    w_c('<form action="wog_act.php" method="post" target="mission" name=f1 >');
    w_c(left_table1);
    w_c('<tr><td colspan="6"><input type="button" value="交易市场" onClick="parent.act_click(\'exchange\',\'view\')"> <input type="button" value="库存明细" onClick="parent.act_click(\'exchange\',\'list\')"></td></tr>');
    w_c('<tr><td></td><td>名称</td><td>价格</td><td>市场剩余量</td><td>涨幅</td><td>涨幅变动时间</td></tr>');
    if (a != "") {
        var s1 = a.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            if (s2[4] == "0") {
                s2[4] = "";
            }
            if (s2[4] == "1") {
                s2[4] = "<font color=red>↑" + s2[6] + "%</font>";
            }
            if (s2[4] == "2") {
                s2[4] = "<font color=green>↓" + s2[6] + "%</font>";
            }
            w_c('<tr><td><input type="radio" name="item_id" value="' + s2[0] + '"></td><td>' + s2[1] + '</td><td>' + s2[2] + '</td><td>' + s2[3] + '</td><td>' + s2[4] + '</td><td>' + s2[5] + '</td></tr>');
        }
    }
    w_c('<tr><td colspan="6">请输入数量:<input type="text" name="item_num" size="16"> <input type="submit" value="确认购入"></td></tr>');
    w_c('<input type="hidden" name="f" value="exchange">');
    w_c('<input type="hidden" name="act" value="buy">');
    w_c(temp_table2);
    w_c('</form>');
    w_c(right_table1);
    w_c('<tr><td>内容</td><td>变动时间</td></tr>');
    if (b != "") {
        var s1 = b.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            w_c('<tr><td>' + s2[0] + '</td><td>' + s2[1] + '</td></tr>');
        }
    }
    w_c(temp_table2);
    p_c();
};

function exchange_list(a) {
    w_c('<form action="wog_act.php" method="post" target="mission" name=f1 >');
    w_c(temp_table1);
    w_c('<tr><td colspan="6"><input type="button" value="交易市场" onClick="parent.act_click(\'exchange\',\'view\')"> <input type="button" value="库存明细" onClick="parent.act_click(\'exchange\',\'list\')"></td></tr>');
    w_c('<tr><td></td><td>名称</td><td>库存数量</td><td>平均成本</td></tr>');
    if (a != "") {
        var s1 = a.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            w_c('<tr><td><input type="radio" name="item_id" value="' + s2[0] + '"></td><td>' + s2[3] + '</td><td>' + s2[1] + '</td><td>' + s2[2] + '</td></tr>');
        }
    }
    w_c('<tr><td colspan="6">请输入数量:<input type="text" name="item_num" size="16"></td></tr>');
    w_c('<tr><td colspan="6"><input type="submit" value="确认卖出"> <input type="button" value="贡献给公会" onClick="parent.foot_gturn(\'ex\',\'exup\',null,document.f1.item_num.value,document.f1.item_id)"></td></tr>');
    w_c('<input type="hidden" name="f" value="exchange">');
    w_c('<input type="hidden" name="act" value="sale">');
    w_c(temp_table2);
    w_c('</form>');
    p_c();
};

function plus_view(a1, a2, a3) {
    //a1:精炼石,a2:精炼石数量,a3:结果,a4:装备数值,a5:装备列表,a6:魔石
    w_c('<form action="wog_act.php" method="post" target="mission" name=f1 >');
    w_c(left_table1);
    w_c('<tr><td colspan=3><a href="javascript:parent.act_click(\'plus\',\'view\')" >精炼石制作</a> <a href="javascript:parent.act_click(\'plus\',\'arm_view\')" >装备精炼</a></td></tr>');
    w_c('<tr class="head_td"><td></td><td>名称</td><td>效果</td></tr>');
    if (a1 != "") {
        vData = a2;
        var s1 = a1.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(":");
            var temps = srhCount(s2[0]);
            var s3 = tmpNum.split(",");
            var temp = plus_buffer_status(s2[2] + ":" + s2[3] + ":" + s2[4] + ":" + s2[5] + ":" + s2[6] + ":" + s2[7] + ":" + s2[8] + ":" + s2[9] + ":" + s2[10] + ":" + s2[11] + ":" + s2[12]);
            for (var j = 0; j < temps; j++) {
                var p_id = i + '_' + j;
                w_c('<tr><td><a href="javascript:parent.plus_add(' + s2[0] + ',\'' + p_id + '\');">添加制作</a></td><td><span id="p_' + p_id + '">' + s2[1] + '*' + s3[j] + '</span></td><td>' + temp + '</td></tr>');
            }
        }
    }
    w_c('<input type="hidden" name="f" value="plus">');
    w_c('<input type="hidden" name="act" value="make">');
    w_c('<tr><td colspan=3>数量:<input type="text" value="1" size="5" maxlength="5" name="item_num"> → <input type="submit" value="开始制作"> <input type="button" value="重置设定" onclick="parent.plus_view(\'' + a1 + '\',\'' + a2 + '\',\'\');"></td></tr>');
    w_c('<tr><td colspan=3 class=b1>' + plus_text + '</td></tr>');
    w_c(temp_table2);
    w_c(right_table1);
    w_c('<tr class="head_td"><td>精炼石1</td><td>精炼石2</td></tr>');
    w_c('<tr><td><span id="t1">　</span></td><td><span id="t2">　</span></td></tr>');
    w_c('<tr><td colspan=2>合成结果→<span id="t3">' + a3 + '</span></td></tr>');
    w_c(temp_table2);
    w_c('<input type="hidden" name="temp1" value="">');
    w_c('<input type="hidden" name="temp2" value="">');
    w_c('<input type="hidden" name="temp3" value="">');
    w_c('</form>');
    p_c();
};

function plus_view2(a1, a2, a3, a4) {
    //a1:精炼石,a2:精炼石数量,a3:结果,a4:装备数值
    p_s_close();
    w_c('<form action="wog_act.php" method="post" target="mission" name=f1 >');
    w_c(left_table1);
    w_c('<tr><td colspan=3><a href="javascript:parent.act_click(\'plus\',\'view\')" >精炼石制作</a> <a href="javascript:parent.act_click(\'plus\',\'arm_view\')" >装备精炼</a></td></tr>');
    w_c('<tr class="head_td"><td></td><td>名称</td><td>效果</td></tr>');
    if (a1 != "") {
        vData = a2;
        var s1 = a1.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(":");
            var temps = srhCount(s2[0]);
            var s3 = tmpNum.split(",");
            var temp = plus_buffer_status(s2[2] + ":" + s2[3] + ":" + s2[4] + ":" + s2[5] + ":" + s2[6] + ":" + s2[7] + ":" + s2[8] + ":" + s2[9] + ":" + s2[10] + ":" + s2[11] + ":" + s2[12]);
            for (var j = 0; j < temps; j++) {
                var p_id = i + '_' + j;
                w_c('<tr><td><a href="javascript:parent.plus_add(' + s2[0] + ',\'' + p_id + '\');">添加制作</a></td><td><span id="p_' + p_id + '">' + s2[1] + '*' + s3[j] + '</span></td><td>' + temp + '</td></tr>');
            }
        }
    }
    w_c('<input type="hidden" name="f" value="plus">');
    w_c('<input type="hidden" name="act" value="make_arm">');
    w_c('<tr><td colspan=3><input type="button" value="开始制作" onclick="parent.plus_make();"> <input type="button" value="重置设定" onclick="parent.plus_view(\'' + a1 + '\',\'' + a2 + '\',\'\');"></td></tr>');
    w_c('<tr><td colspan=3 class=b1>' + plus_text + '</td></tr>');
    w_c(temp_table2);
    w_c(right_table1);
    w_c('<tr><td colspan="7"><a href="javascript:parent.act_click(\'plus\',\'arm_view\',\'a_id\')" target="mission">武器</a> <a href="javascript:parent.act_click(\'plus\',\'arm_view\',\'d_head_id\')" target="mission">头部</a> <a href="javascript:parent.act_click(\'plus\',\'arm_view\',\'d_body_id\')" target="mission">身体</a> <a href="javascript:parent.act_click(\'plus\',\'arm_view\',\'d_hand_id\')" target="mission">手部</a> <a href="javascript:parent.act_click(\'plus\',\'arm_view\',\'d_foot_id\')" target="mission">脚部</a></td></tr>');
    w_c('<tr class="head_td"><td></td><td>名称</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>能力限制</td></tr>');

    if (a4 != "") {
        var s1 = a4.split(";");
        for (var i = 0; i < s1.length; i++) {
            var s2 = s1[i].split(",");
            var arm_view_color = "";
            if (s2[20] == "1") {
                arm_view_color = "bgcolor=" + nosend;
            }
            var temp_message = s2[2] + "," + s2[7] + "," + s2[8] + "," + s2[9] + "," + s2[10] + "," + s2[11] + "," + s2[12] + "," + s2[13] + "," + s2[14] + "," + s2[15] + "," + s2[22] + "," + s2[23] + "," + s2[21] + "," + s2[24];
            w_c('<tr><td><a href="javascript:parent.plus_add1(\'' + s2[1] + '\');">添加制作</a></td><td ' + arm_view_color + '><a class="uline" onmouseover=parent.wog_message_box("' + temp_message + '",1,4,null,event.x||event.pageX,event.y||event.pageY); onmouseout=parent.hidebox(\'wog_message_box\'); onclick="parent.arm_show(event.ctrlKey,\'' + s2[2] + '\',\'' + s2[1] + '\');" target="mission"><span id="a_' + s2[1] + '">' + s2[2] + '</span></a></td><td>' + bf_c(s2[3]) + '</td><td>' + bf_c(s2[4]) + '</td><td>' + bf_c(s2[5]) + '</td><td>' + bf_c(s2[6]) + '</td><td>' + arm_need_status(s2[16], s2[17], s2[18], s2[19]) + '</td></tr>');
        }
    }
    w_c('<tr><td colspan=7><span id="t1">　</span> + <span id="t2">　</span></td></tr>');
    w_c('<tr><td colspan=7>合成结果→<span id="t3">' + a3 + '</span></td></tr>');
    w_c(temp_table2);
    w_c('<input type="hidden" name="temp1" value="">');
    w_c('<input type="hidden" name="temp2" value="">');
    w_c('<input type="hidden" name="temp3" value="">');
    w_c('<input type="hidden" name="set" value="">');
    w_c('</form>');
    p_c();
};

function plus_make() {
    w_c(temp_table1);
    w_c('<tr class="head_td"><td>使否使用安全精炼石</td></tr>');
    w_c('<tr><td><input type="radio" name="set" value="1">是 <input type="radio" name="set" value="2" checked>否</td></tr>');
    w_c('<tr><td>使用安全精炼石，可以确保失败时精炼石不会损坏。使用前请确认背包里面是否有该物品，若无请至<a class="uline" onclick="parent.p_s_close();parent.act_click(\'mall\',\'view\');">商城购买</a></td></tr>');
    w_c('<tr><td colspan="3"><input type="button" value="确认" onclick="parent.plus_send();"> | <input type="button" value="关闭" onClick="parent.p_s_close();" ></td></tr>');
    w_c(temp_table2);
    set_window();
    x = UI.window_w / 2 - (350 / 2);
    y = UI.window_h / 2;
    p_as(x, y, 480);
};

function plus_send() {
    if (f.f101.set[0].checked == true) {
        f.f1.set.value = "1";
    } else {
        f.f1.set.value = "2";
    }
    f.f1.submit();
};

function plus_add(a1, a2) {
    var s1 = f.getElementById("p_" + a2).innerHTML.split("*");
    var t_num = parseInt(s1[1]);
    var temp_a3 = f.f1.temp3.value;
    if (t_num <= 0) {
        return;
    }
    s1[2] = s1[0];
    s1[0] = "‘" + s1[0] + "’";
    if (f.f1.temp1.value != "" && f.f1.act.value == "make") {
        f.f1.temp2.value = a1;
        f.f1.temp3.value = a2;
        f.getElementById("t2").innerHTML = s1[0];
    } else {
        if (f.f1.act.value == "make_arm") {
            f.f1.temp3.value = a2;
        }
        f.f1.temp1.value = a1;
        f.getElementById("t1").innerHTML = s1[0];
    }
    t_num -= 1;
    if (temp_a3 != "" && temp_a3 != a2) {
        var s2 = f.getElementById("p_" + temp_a3).innerHTML.split("*");
        var t_num2 = parseInt(s2[1]);
        t_num2++;
        f.getElementById("p_" + temp_a3).innerHTML = s2[0] + "*" + t_num2;
    }
    if (temp_a3 != a2) {
        f.getElementById("p_" + a2).innerHTML = s1[2] + "*" + t_num;
    }
    f.getElementById("t3").innerHTML = "";
};

function plus_add1(a1) {
    f.f1.temp2.value = a1;
    f.getElementById("t2").innerHTML = "‘" + f.getElementById("a_" + a1).innerHTML + "’";
    f.getElementById("t3").innerHTML = "";
};

function plus_buffer_status(a1) {
    var temp = "";
    var s1 = a1.split(":");
    for (var i = 0; i < s1.length; i++) {
        if (s1[i] != "") {
            var s2 = s1[i].split(",");
            switch (i) {
                case 0:
                    temp += " 物攻:" + s2[0] + "-" + s2[1];
                    break;
                case 1:
                    temp += " 魔攻:" + s2[0] + "-" + s2[1];
                    break;
                case 2:
                    temp += " 物防:" + s2[0] + "-" + s2[1];
                    break;
                case 3:
                    temp += " 魔防:" + s2[0] + "-" + s2[1];
                    break;
                case 4:
                    temp += " 力量:" + s2[0] + "-" + s2[1];
                    break;
                case 5:
                    temp += " 敏捷:" + s2[0] + "-" + s2[1];
                    break;
                case 6:
                    temp += " 智力:" + s2[0] + "-" + s2[1];
                    break;
                case 7:
                    temp += " 生命:" + s2[0] + "-" + s2[1];
                    break;
                case 8:
                    temp += " 体质:" + s2[0] + "-" + s2[1];
                    break;
                case 9:
                    temp += " 魅力:" + s2[0] + "-" + s2[1];
                    break;
                case 10:
                    temp += " 信仰:" + s2[0] + "-" + s2[1];
                    break;
            }
        }
    }
    return temp;
};

// 修改：添加隐藏商店
function mshop_view(name, img, message, mslist) {
    setup_mname(name);
    if (!img) {
        img = "no_img.jpg";
    }
    if (img.indexOf('http') == -1) {
        img = mimg + img;
    }
    w_c('<form action="wog_act.php" method="post" target="mission" name=f1 >');
    w_c(temp_table1);
    w_c('<tr class="head_td"><td colspan="2">商店</td></tr>');
    w_c('<tr><td>' + name + '<br/><img src="' + img + '"/></td><td>' + message + '</td></tr>');
    w_c(temp_table2);
    w_c(temp_table1);
    w_c('<thead><tr class="head_td"><td>选择</td><td>商品</td><td>价格</td></tr></thead>');
    w_c('<tfoot><tr class="head_td"><td colspan="3"><input type="submit" value="购买"/></td></tr></tfoot>');
    w_c('<tbody>');
    mslist = mslist.split(';');
    for (let i = 0, len = mslist.length; i < len; ++i) {
        var str = mslist[i].split(',');
        w_c('<tr><td><input type="radio" name="ms_id" value="' + str[0] + '"></td><td>' + str[1] + '</td><td>' + str[2] + '</td></tr>');
    }
    w_c('</tbody>');
    w_c(temp_table2);
    w_c('<input type="hidden" name="f" value="shop"/>');
    w_c('<input type="hidden" name="act" value="mshop_buy"/>');
    w_c('</form>');
    p_c();
}
